//
//  YHIMManager.h
//  YHChat
//
//  Created by 银河 on 2019/2/17.
//  Copyright © 2019 yinhe. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@class TIMMessage;
@class YHChatConversationModel;
@interface YHIMManager : NSObject

+ (instancetype)sharedManager;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

@property (nonatomic, copy) void(^conversationChangeBlock)(NSArray<YHChatConversationModel *> *conversationList);

@property (nonatomic, copy) void(^receiveNewMsgsBlock)(NSArray<TIMMessage *> *messages);

#pragma mark - SDK Init
// SDK Init.
- (void)initSDKWithAppID:(NSString *)appID accountType:(NSString *)accountType;

#pragma mark - IM Login
// IM Login.
- (void)loginWithIdentifier:(NSString *)identifier userSign:(NSString *)userSign appidAt3rd:(NSString *)appidAt3rd completionBlock:(void(^_Nullable)(NSError *_Nullable error))completionBlock;

#pragma mark - IM Logout
// IM Logout.
- (void)logoutWithCompletionBlock:(void(^_Nullable)(NSError *_Nullable error))completionBlock;


#pragma mark - Conversation
// 获取所有会话列表
- (void)loadAllConversationList;

@end

NS_ASSUME_NONNULL_END
